<template>
    <div class="modal-footer">
        <!-- confirm弹框显示两个按钮 -->
        <button @click="onCancel" v-if="type == 'confirm'">取消</button>
        <button @click="onConfirm">确定</button>
    </div>
</template>
<script setup>
import { inject } from 'vue'
 // 获取弹框类型
const type = inject('modelType', 'default')

// emit
const emit = defineEmits(['cancel', 'confirm'])
const onCancel = () => {
    emit("cancel", false)
}

const onConfirm = () => {
    emit('confirm', true)
}
</script>